<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String port = request.getServerPort() == 80 ? "" : ":".concat(request.getServerPort()+"");
	String path = request.getScheme().concat("://").concat(request.getServerName()).concat(port).concat(request.getContextPath());
	request.setAttribute("path", path);
	String version = new SimpleDateFormat("yyyyMMdd").format(new Date());	
%>
<!DOCTYPE html>
<html>
<head>
<title>${g.gname } - <c:if test="${param.page != null }">第${param.page }页 - </c:if>IT答案网</title>
<meta name="keywords" content="${g.gname },IT搜索,问题搜索,Web前端,企业架构,编程语言,互联网,系统运维,云计算,数据库,移动开发,JAVA问题,Android问题,IOS问题,c/c++问题,解决方案" />
<meta name="description" content="我的IT知识库-${g.gname } 标签结果" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="${path }/view/portal/css/all.css?version=<%=version %>" rel="stylesheet">
<link href="${path }/view/portal/css/prettify.css?version=<%=version %>" rel="stylesheet">
<script src="${path }/view/portal/js/all.js?version=<%=version %>"></script>
<script src="${path }/view/portal/js/code.js?version=<%=version %>"></script>
</head>
<body onload="prettyPrint()">
    <jsp:include page="head.jsp"></jsp:include>
	<div class="container container1000">
		<div class="row-fluid" style="margin-bottom:20px;">
			<div class="span2" id="logo">
				<center>
					<a href="index.html"><img src="view/portal/img/logo-1.png?version=<%=version %>" style="height: 30px;"/></a>
				</center>
			</div>
			<div class="span6">
				<form class="form-search" action="so" name="search-form">
					<div class="input-append span10">
						<center>
							<input type="text" class="span12 search-query"
								name="q" value="" placeholder="${param.q }" baiduSug="1">
							<input type="hidden" name="t" value="2"/>
							<input type="hidden" name="l" value="0"/>
							<input type="hidden" name="g" value="${param.id }"/>									
							<button type="submit" class="btn btn-success">搜索答案</button>
						</center>
					</div>
				</form>
			</div>
			<div class="span4 visible-desktop" style="vertical-align: middle;padding-top:10px;color:gray;font-size:13px;">花费 <span style="color:green;font-weight:bold;font-style:italic;">${costTime }ms</span> 找到<span style="color:green;font-weight:bold;font-style:italic;">${solrPage.totalRow }</span>条记录</div>
		</div>
		<div class="row-fluid">
			<div class="span9" style="width:700px;">
			   <c:if test="${solrPage.totalRow != 0}">
			      <div class="content_div">
					<c:forEach items="${results }" var="post" varStatus="status">
					<div class="media">
	                  <div class="media-body">
	                    <dt><span class="badge badge-success">${10*(param.page == null ? 0 : (param.page-1))+status.index+1 }</span><a href="<c:if test='${post.isHtmlCreated == 0 }'>post-${post.typeId }-${post.id }.html</c:if><c:if test='${post.isHtmlCreated == 1 }'><c:if test='${post.typeId == 1 }'>blog</c:if><c:if test='${post.typeId == 2 }'>faq</c:if>/<fmt:formatDate value="${post.postTime }" pattern="yyyy/MM/dd"/>/${post.id }.html</c:if>" target="_blank" style="color:#1a0dab">${post.title }<i class="icon-flag"></i></a></dt>
	                    <dd><c:out value="${post.content }" escapeXml="false"></c:out></dd>
	                  </div>
	               </div>
					</c:forEach>
			     </div>
			    <div class="pagination">${pageHtml }</div>
			    <br/>
			  </c:if>  
			  <c:if test="${solrPage.totalRow == 0}">
			    <span><br/>抱歉，目前公测阶段索引量不够，未帮您找到合适的答案，我们会加大索引量，谢谢您的支持。</span>
			  </c:if>			    
			</div>
			<div class="span3 left_content"  style="width:250px;text-overflow:ellipsis; word-break:keep-all; overflow:hidden;white-space: nowrap;font-size:12px;">
		   	  <div class="list-group-head" href="javascript:void(0)" style="background-color:#5bb75b;background-image: linear-gradient(to bottom, #62c462, #51a351);color:white"><i class="icon-th-list icon-white"></i><span style="margin-left:5px">分类标签</span></div>
			  <c:forEach items="${groups }" var="group">
			  <c:set var="groupId" ><c:out value="${group.id }"/></c:set>
			     <c:if test="${param.id == group.id}">
			        <a class="list-group-item active" href="group-${group.id }.html"><span class="badge" style="background-color:green;"><c:if test="${groupCountMap[groupId] < 10000}"><c:out value="${groupCountMap[groupId] == null ? 0 : groupCountMap[groupId]}" /></c:if><c:if test="${groupCountMap[groupId] >= 10000}">≈<fmt:formatNumber value="${groupCountMap[groupId]/10000}" maxFractionDigits="0"></fmt:formatNumber>万</c:if></span><c:if test="${groupCountMap[groupId] >= 10000}"><i class="icon-fire icon-red"></i></c:if> ${group.gname }</a>
			     </c:if>
			     <c:if test="${param.id != group.id }">
			         <a class="list-group-item" href="group-${group.id }.html"><span class="badge" style="background-color:green;"><c:if test="${groupCountMap[groupId] < 10000}"><c:out value="${groupCountMap[groupId] == null ? 0 : groupCountMap[groupId]}" /></c:if><c:if test="${groupCountMap[groupId] >= 10000}">≈<fmt:formatNumber value="${groupCountMap[groupId]/10000}" maxFractionDigits="0"></fmt:formatNumber>万</c:if></span><c:if test="${groupCountMap[groupId] >= 10000}"><i class="icon-fire icon-red"></i></c:if> ${group.gname }</a>
			     </c:if>
			  </c:forEach>
			</div>			
		</div>
	</div>
    <div class="clear">&nbsp;</div>
    <input name="path" value="${path }" type="hidden"/>
	<jsp:include page="bottom.jsp"></jsp:include>
</body>
</html>